﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo04
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = {1,2,3,4,5};
            Console.WriteLine("请输入要查找的数：");
            int a = int.Parse(Console.ReadLine());
            int b = -1;
            for (int i = 0; i < arr.Length; i++)
            {
                if (a == arr[i])
                {
                    b = i;
                }
            }
            if (b == -1)
            {
                Console.WriteLine("您输入的数找不到！");
            }
            else
            {
                Console.WriteLine("你输入的数最后一次出现的位置是{0}：",b);
            }
        }
    }
}
